<template>
  <NavigationVue title="CHAT">
	 <template v-slot:right>
	  		  <up-icon name="plus-circle"  size="24"></up-icon>
	  </template> 
	  <!-- <template v-slot:left>
		  <up-icon name="plus-circle"  size="24"></up-icon>
	  </template> -->
  </NavigationVue>
  <view class="content">
    <image class="logo" src="/static/logo.png"></image>
    <view class="text-area b-1px b-solid b-color-red">
      <text class="title">{{ title }}</text>
	  <button type="primary" @click="countStore.count++">点击添加{{count}}</button>
	  <button type="primary" @click="getList">点击请求数据</button>
	  <text class="i-ep-apple w-40rpx h-40rpx color-red"></text>
	  <div class="i-ep:arrow-up w-1em h-1em"></div>
	  <div>
		  {{ $t('settings') }}
	  </div>
    </view>
  </view>
</template>

<script setup>
import NavigationVue from '../../components/Navigation.vue';
import { useRequest } from '../../api';
import { useCountStore } from '../../store';
import { changeLocale } from '../../locale/utils';

const {DEMO_CAPTCHA_GET,DEMO_LOGIN_GET} = useRequest();
const title = ref("hello word");
const  countStore = useCountStore();
// const {i18n} = useI18n()
// uni.setLocale('en')
// console.log(uni.getLocale())
const count = computed(()=>countStore.count)
const getList = ()=>{
	DEMO_CAPTCHA_GET().then((res)=>{
		console.log(res)
	})
	DEMO_LOGIN_GET().then((res)=>{
		console.log("DEMO_LOGIN_GET",res)
	})
	
	changeLocale((uni.getLocale() == 'zh-Hans') ? 'en' : 'zh-Hans')
	// console.log(uni.getLocale())
	// i18n.global.locale = uni.getLocale()
	// t.locale = uni.getLocale()
}
</script>

<style scoped>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 200rpx;
  width: 200rpx;
  margin-top: 200rpx;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50rpx;
}

.text-area {
  display: flex;
  justify-content: center;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
}
</style>
